<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/commons/inc.jsp" %>

<h3 id="navTitleId">运动调查</h3>

<script>
function nosportsReason(){
	var a = '<s:property value='sportsSurvey.noreason'/>';
	if(a!=null && a!=''){
		a = a.split(",");
		for(var i=0;i<a.length;i++){
			$('n'+a[i].trim()).checked = true;
		}
	}
}
</script>

<body id="body">

<%@include file="/commons/showmessage.jsp" %>

<form name="sportform" id="sportform" method="post" action="${contextPath}/sport/sport.action?method=saveEditSportsSurvey">
	<s:hidden name="sportsSurvey.sportssurveyid" id="sportsSurvey.sportssurveyid"></s:hidden>
	<s:hidden name="sportsSurvey.patientid" id="sportsSurvey.patientid"></s:hidden>
	<s:hidden name="patientid" id="patientid"></s:hidden>
	<table>
		<tr>
			<td><label class="label">劳动强度分级:</label></td>
			<td><input style="vertical-align:sub;" type="radio" name="sportsSurvey.worksports" id="sportsSurvey.worksports1" <s:if test="sportsSurvey.worksports==0">checked</s:if> value="0"/>
				<font style="vertical-align:sub;">卧床休息</font> </td>
		</tr>
		<tr>
			<td></td>
			<td><input style="vertical-align:sub;" type="radio" name="sportsSurvey.worksports" id="sportsSurvey.worksports2" <s:if test="sportsSurvey.worksports==1">checked</s:if> value="1"/>
				<font style="vertical-align:sub;">轻度活动（75%时间坐或站立；25%时间站着活动）</font></td>
		</tr>
		<tr>
			<td></td>
			<td><input style="vertical-align:sub;" type="radio" name="sportsSurvey.worksports" id="sportsSurvey.worksports3" <s:if test="sportsSurvey.worksports==2">checked</s:if> value="2"/>
				<font style="vertical-align:sub;">中度活动（25%时间坐或站立；75%时间特殊活动）</font></td>
		</tr>
		<tr>
			<td></td>
			<td><input style="vertical-align:sub;" type="radio" name="sportsSurvey.worksports" id="sportsSurvey.worksports4" <s:if test="sportsSurvey.worksports==3">checked</s:if> value="3"/>
				<font style="vertical-align:sub;">重度活动（40%时间坐或站立；60%时间特殊活动）</font></td>
		</tr>
	</table>
	<table>
		<tr>
			<td class="tdLabel" colspan="2"><label class="label">您平时是否进行有规律的运动锻炼？</label> 
			 <select name="sportsSurvey.isregular" id="sportsSurvey.isregular" onchange="javascript:isOrnot();">
					<option value="0" <s:if test="sportsSurvey.isregular == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="sportsSurvey.isregular == 1">selected</s:if>>是</option>
					<option value="2" <s:if test="sportsSurvey.isregular == 2">selected</s:if>>否</option>
			</select></td>
		</tr>	
		<tr>
			<td class="tdLabel" colspan="2"><label class="label">您不愿运动锻炼的原因是什么？</label></td>
			<td><input type="checkbox" id="n1" name="sportsSurvey.noreason" <s:if test="sportsSurvey.isregular==0">disabled="true"</s:if> value="1"/><font style="vertical-align:bottom;">没兴趣</font>
				<input type="checkbox" id="n2" name="sportsSurvey.noreason" <s:if test="sportsSurvey.isregular==0">disabled="true"</s:if> value="2"/><font style="vertical-align:bottom;">没时间</font>
				<input type="checkbox" id="n3" name="sportsSurvey.noreason" <s:if test="sportsSurvey.isregular==0">disabled="true"</s:if> value="3"/><font style="vertical-align:bottom;">惰性，没有毅力坚持</font>
				<input type="checkbox" id="n4" name="sportsSurvey.noreason" <s:if test="sportsSurvey.isregular==0">disabled="true"</s:if> value="4"/><font style="vertical-align:bottom;">体力工作，没有必要参加 </font>
				<br>
		 		<input type="checkbox" id="n5" name="sportsSurvey.noreason" <s:if test="sportsSurvey.isregular==0">disabled="true"</s:if> value="5"/><font style="vertical-align:bottom;">缺乏场地设施</font>
				<input type="checkbox" id="n6" name="sportsSurvey.noreason" <s:if test="sportsSurvey.isregular==0">disabled="true"</s:if> value="6"/><font style="vertical-align:bottom;">身体不适，不宜参加</font>
				<input type="checkbox" id="n7" name="sportsSurvey.noreason" <s:if test="sportsSurvey.isregular==0">disabled="true"</s:if> value="7"/><font style="vertical-align:bottom;">运动后身体不适（头晕、心慌、胸闷、胃痛、低血糖反应）</font>
				<script>nosportsReason();</script></td>		 
		</tr>
		</table>
		<table>
		<tr>
			<td class="tdLabel"><label class="label">您经常进行什么形式的运动锻炼？</label></td>
			<td><input style="vertical-align:sub;" type="radio" name="sportsSurvey.sportstype" id="sportsSurvey.sportstype1" <s:if test="sportsSurvey.sportstype==0">checked</s:if> <s:if test="sportsSurvey.isregular==1">disabled="true"</s:if> value="0"/><font style="vertical-align:sub;">轻度活动（种花、家务、步行等) </font>
			 	<br><input style="vertical-align:sub;" type="radio" name="sportsSurvey.sportstype" id="sportsSurvey.sportstype2" <s:if test="sportsSurvey.sportstype==1">checked</s:if> <s:if test="sportsSurvey.isregular==1">disabled="true"</s:if> value="1"/><font style="vertical-align:sub;">中度活动（慢跑、羽毛球、健身操、健身气功、跳舞等) </font>
				<br><input style="vertical-align:sub;" type="radio" name="sportsSurvey.sportstype" id="sportsSurvey.sportstype3" <s:if test="sportsSurvey.sportstype==2">checked</s:if> <s:if test="sportsSurvey.isregular==1">disabled="true"</s:if> value="2"/><font style="vertical-align:sub;">重度活动（举杠铃、游泳、跳绳等）</font></td> 
			<td class="tdLabel" colspan="2">
			
			<table>
				<tr>
					<td><label class="label">运动锻炼方式:</label></td>
					<td><select name="sportsSurvey.sportsway" id="sportsSurvey.sportsway">
							<option value="0" <s:if test="sportsSurvey.sportsway == 0">selected</s:if>>请选择</option>
							<option value="1" <s:if test="sportsSurvey.sportsway == 1">selected</s:if>>个人运动</option>
							<option value="2" <s:if test="sportsSurvey.sportsway == 2">selected</s:if>>集体运动</option>
						</select></td>
				 </tr>
				<tr>
					<td><label class="label">运动锻炼时间:</label></td>
					<td><select name="sportsSurvey.sportstime" id="sportsSurvey.sportstime">
							<option value="0" <s:if test="sportsSurvey.sportstime == 0">selected</s:if>>请选择</option>
							<option value="1" <s:if test="sportsSurvey.sportstime == 1">selected</s:if>>早上</option>
							<option value="2" <s:if test="sportsSurvey.sportstime == 2">selected</s:if>>上午</option>
							<option value="3" <s:if test="sportsSurvey.sportstime == 3">selected</s:if>>下午</option>
							<option value="4" <s:if test="sportsSurvey.sportstime == 4">selected</s:if>>晚饭后</option>
						</select></td>
				 </tr>
				 <tr>
					<td class="tdLabel"><label class="label">平均一周运动锻炼次数:</label></td>
					<td><select name="sportsSurvey.sportscount" id="sportsSurvey.sportscount">
							<option value="0" <s:if test="sportsSurvey.sportscount == 0">selected</s:if>>请选择</option>
							<option value="1" <s:if test="sportsSurvey.sportscount == 1">selected</s:if>>1~2次</option>
							<option value="2" <s:if test="sportsSurvey.sportscount == 2">selected</s:if>>3~4次</option>
							<option value="3" <s:if test="sportsSurvey.sportscount == 3">selected</s:if>>5~7次</option>
							<option value="4" <s:if test="sportsSurvey.sportscount == 4">selected</s:if>>>7次</option>
						</select></td>
				 </tr>
				 <tr>
					<td class="tdLabel"><label class="label">每次运动锻炼持续时间:</label></td>
					<td><select name="sportsSurvey.sportslast" id="sportsSurvey.sportslast">
							<option value="0" <s:if test="sportsSurvey.sportslast == 0">selected</s:if>>请选择</option>
							<option value="1" <s:if test="sportsSurvey.sportslast == 1">selected</s:if>><30min</option>
							<option value="2" <s:if test="sportsSurvey.sportslast == 2">selected</s:if>>30-60min</option>
							<option value="3" <s:if test="sportsSurvey.sportslast == 3">selected</s:if>>60-90min</option>
							<option value="4" <s:if test="sportsSurvey.sportslast == 4">selected</s:if>>>90min</option>
						</select></td>
				</tr>
			</table></td>
		</tr>
		 </table>
		 <table>
		<tr>
			<td class="tdLabel"><label class="label">您进行运动锻炼前是否进餐？:</label></td>
			<td><select name="sportsSurvey.takemeal" id="sportsSurvey.takemeal">
					<option value="0" <s:if test="sportsSurvey.takemeal == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="sportsSurvey.takemeal == 1">selected</s:if>>是</option>
					<option value="2" <s:if test="sportsSurvey.takemeal == 2">selected</s:if>>否</option>
				</select></td>	
		</tr>
		<tr>
			<td class="tdLabel"><label class="label">您进行运动锻炼前是否服用降糖药物或注射胰岛素？:</label></td>
				<td><select name="sportsSurvey.takedrug" id="sportsSurvey.takedrug">
						<option value="0" <s:if test="sportsSurvey.takedrug == 0">selected</s:if>>请选择</option>
						<option value="1" <s:if test="sportsSurvey.takedrug == 1">selected</s:if>>是</option>
						<option value="2" <s:if test="sportsSurvey.takedrug == 2">selected</s:if>>否</option>
					</select></td>
		</tr>
		<tr>
			<td class="tdLabel"><label class="label">您是否因运动锻炼而受伤？:</label></td>
			<td><select name="sportsSurvey.ishurt" id="sportsSurvey.ishurt">
					<option value="0" <s:if test="sportsSurvey.ishurt == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="sportsSurvey.ishurt == 1">selected</s:if>>是</option>
					<option value="2" <s:if test="sportsSurvey.ishurt == 2">selected</s:if>>否</option>
				</select></td>
		</tr>
		<tr>
			<td align="center" colspan="2">
			<input type="reset" value="重置"> 
		    <input type="button" onclick="saveEdit('save');" value="保存"></td>
		</tr>
	</table>
</form>

<%@include file="/commons/tableSel.jsp" %>

</body>

<style type="text/css">
body {
	height: 100%;
	width: 100%;
}
</style>

<script>
function saveEdit(type){
	if(type=='refresh'){
		location.reload();
	}else if(type=='save'){
		if(!Validator.Validate($('sportform'),3)){
			return;
		}	
		$('sportform').submit();
	}
}
function isOrnot(){
	var flag = $('sportsSurvey.isregular').value==1?true:false;
	for(var i=1;i<8;i++){
		$('n'+i).disabled=flag;
	}
//	for(i=1;i<4;i++){
//		$('b'+i).disabled=!flag;
//	}
	$('sportsSurvey.sportstype1').disabled=!flag;
	$('sportsSurvey.sportstype2').disabled=!flag;
	$('sportsSurvey.sportstype3').disabled=!flag;
	$('sportsSurvey.sportstime').disabled=!flag;
	$('sportsSurvey.sportscount').disabled=!flag;
	$('sportsSurvey.sportslast').disabled=!flag;
	$('sportsSurvey.ishurt').disabled=!flag;
	$('sportsSurvey.sportsway').disabled=!flag;
	$('sportsSurvey.takemeal').disabled=!flag;
	$('sportsSurvey.takedrug').disabled=!flag;
}
</script>